package apof.model
{
	import apof.dao.Dao;
	import apof.model.User;
	
	public class Account extends ApofModel
	{
		public var aid:int;
		public var name:String;
		public var balance:Number;
		public var uid:int;
		public var user:User=null;
		
		public var transections:Array=new Array();
		

		//private static var init:Boolean = onInit();
		public static function onInit():Boolean {
			var pt:Object=prototype;
			pt.classname="Account";		
			pt.fields=["aid","uid","name","balance"];
			pt.fieldTypes=["INTEGER","INTEGER","VARCHAR(60)","NUMBER"];
			pt.primaryKey="aid";
			pt.foreignKey={	"uid":			{"linkto":User,			"aggregate":false,	"ref":"user",			"peerlink":"accounts"},
							"transections":	{"linkto":Transection,	"aggregate":true,	"ref":"transections",	"peerlink":"aid"}
							};
			return true;
		}
		
		public override function get classInfo():Object {return prototype;}
		public static function get classInfo():Object {return prototype;}
		
	}
}